/* 
 * File:   Camera.h
 * Author: brady
 *
 * Created on February 1, 2011, 3:02 PM
 */

#include <Vector3D.h>
#include "Ray.h"
using namespace cs5721;
using namespace std;

#ifndef CAMERA_H
#define	CAMERA_H

class Camera {
public:
    Camera();
    Camera(Vector3D origin, Vector3D gaze);
    Camera(const Camera& orig);
    virtual ~Camera();
    void SetFrameWidth(double width);
    double GetFrameWidth(){return FrameWidth;}
    double GetFrameHeight(){return FrameWidth/aspectRatio;}
    void SetResolution(int Xres, int Yres);
    int GetXResolution(){return ResolutionX;}
    int GetYResolution(){return ResolutionY;}
    void SetFocalLength(double length);
    double GetFocalLength(){return FocalLength;}
    Vector3D GetGaze(){return Gaze;};
    Vector3D GetOrigin(){return Origin;}
    Vector3D GetU(){return U;}
    Vector3D GetV(){return V;}
    Vector3D GetW(){return W;}
    double GetAspectRatio() {return aspectRatio;}
    void SetAspectRatio(double ar){aspectRatio = ar;}
    void SetGaze(Vector3D gaze);
    void SetOrigin(Vector3D origin);
    Ray ComputeRay(int row, int col, int spp, int sampleNum);
    
    
private:
    void BuildBasis();
    double aspectRatio;
    Vector3D Gaze;
    Vector3D Origin;
    Vector3D U, V, W;
    double FocalLength;
    double FrameWidth;
    double FrameHeight;
    int ResolutionX;
    int ResolutionY;

};

#endif	/* CAMERA_H */

